package java008_6;

import java.util.Scanner;

public class guo7 {
	public static void main(String[] arg) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int flag = 0;
		if(num%7 == 0 ||containsSeven(num)) {
			System.out.println(num);
		}else {
			System.out.println("不满足条件");
		}
	}
	
	
	
	
	private static boolean containsSeven(int number) {
        while (number != 0) {
            int digit = number % 10;
            if (digit == 7) {
                return true;
            }
            number /= 10;
        }
        return false;
    }
}
